package ru.mcfr.oxygen.framework.extensions;

import ro.sync.ecss.css.Styles;
import ro.sync.ecss.extensions.api.StylesFilter;
import ro.sync.ecss.extensions.api.node.AuthorNode;

/**
 * Style Filter for Simple Documentation Framework.
 */
public class MOFStylesFilter implements StylesFilter {

    /**
     * Filter the style of "para", "b" and "i" elements.
     */
    public Styles filter(Styles styles, AuthorNode authorNode) {
        //Use fixed font size of 12 for "para".

//        Font font = styles.getFont();
//        final Font newFont = new Font(font.getName(),font.getStyle(),font.getSize() + 5);
//        styles.setProperty(Styles.KEY_FONT, newFont);


//        if (authorNode.getName().equals("para")) {
//            ro.sync.exml.view.graphics.Font original = styles.getFont();
//            ro.sync.exml.view.graphics.Font modified = new ro.sync.exml.view.graphics.Font(
//                    original.getName(), original.getStyle(), 12);
//            styles.setProperty(Styles.KEY_FONT, modified);
//        }
//
//        //Use foreground color red for "b"
//        if (authorNode.getName().equals("b")) {
//            ro.sync.exml.view.graphics.Color red = ro.sync.exml.view.graphics.Color.COLOR_RED;
//            styles.setProperty(Styles.KEY_FOREGROUND_COLOR, red);
//        }
//
//        //Use left border width of 5 pixels for "i"
//        if (authorNode.getName().equals("i")) {
//            styles.setProperty(Styles.KEY_BORDER_LEFT_WIDTH, new Integer(5));
//        }

        return styles;
    }

    /**
     * Description.
     */
    public String getDescription() {
        return "Implementation for the Simple Documentation Framework style filter.";
    }
}
